package us.gaaoc.framework.dao;

import org.hibernate.Query;

import us.gaaoc.framework.model.Person;
import us.gaaoc.framework.model.PersonOrganizations;

public class PersonOrganizationsDAOHibernate
		extends
		GenericHibernateDAO<PersonOrganizations, String, PersonOrganizationsDAO>
		implements PersonOrganizationsDAO {

	@Override
	public PersonOrganizations findPersonOrganizationByCourtAndPerson(Person personFiler,
			String courtUuid) {
		Query q = this.getSession().createQuery("from PersonOrganizations where person = ? and courtUuid = ?");
		q.setEntity(0, personFiler);
		q.setString(1,courtUuid);
		
		PersonOrganizations po = (PersonOrganizations)  q.uniqueResult();
		return po;
	}
}
